package great.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import great.project.mapper.SysUserMapper;
import great.project.mapper.SysUserRoleMapper;
import great.project.pojo.entity.SysUser;
import great.project.service.SysUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
  *
  *@author RichMan
 * @date 2020-12-27 23:18
  */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    /**
     *   <div  style="height:10px;width:200px;font-size:15px;text-align:center;color:red;">
     *
     *  sysUserRoleMapper
     *
     *  </div>
     */
    @Resource
    private SysUserRoleMapper sysUserRoleMapper;
    @Override
    public List<String> getUserRoleName() {

        QueryWrapper<Object> queryWrapper = new QueryWrapper<>();

        queryWrapper.eq("sys_user_role.user_id", 1);

        return sysUserRoleMapper.getUserRoleName(queryWrapper);
    }

    @Override
    public List<SysUser> selectBySex() {
        return this.getBaseMapper().selectBySex();
    }

}
